package com.hlpedu.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Component
@PropertySource("classpath:values.properties")
public class Cat {
    //@Value("旺财")
//    @Value("${c.cname}")
    //@Value("#{c.cname}"),此形式读取配置文件的值会报语法错误
    @Value("#{'${c.cname}'}")
    private String cname;
    //@Value("2")
    //@Value("${c.cage}")
    //@Value("#{c.cname}")
   // @Value("#{'${c.cage}'}")
    //@Value("#{4}")
    @Value("#{1+4}")
    private Integer cage;


}
